CC = gcc
CFLAGS = -Wall -IModuleA -IModuleB

all: modulea moduleb main

modulea:
	$(MAKE) -C ModuleA
moduleb:
	$(MAKE) -C ModuleB
main: main.c
	$(CC) $(CFLAGS) -o RELEASE/myproject.out main.c RELEASE/modulea.o RELEASE/moduleb.o

.PHONY: clean run
clean:
	cd ModuleA && $(MAKE) clean
	cd ModuleB && $(MAKE) clean
	rm -f RELEASE/myproject.out

run : RELEASE/myproject.out
	@./$<